// 产品工段;
import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/mes-product/work-section/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const add = (row) => {
  return request({
    url: '/api/mes-product/work-section/submit',
    method: 'post',
    data: row
  });
};

export const update = (row) => {
  return request({
    url: '/api/mes-product/work-section/submit',
    method: 'post',
    data: row
  });
};

export const remove = (ids) => {
  return request({
    url: '/api/mes-product/work-section/remove',
    method: 'get',
    params: {
      ids
    }
  });
};

export const getDetail = (id) => {
  return request({
    url: '/api/mes-product/work-section/detail',
    method: 'get',
    params: {
      id
    }
  });
};

// 获取所有生产工段
export const getAllWorkSection = () => {
  return request({
    url: '/api/mes-product/product/worksection/all-section',
    method: 'get'
  });
};

// 获取所有产品工段
export const getAllProductSection = () => {
  return request({
    url: '/api/mes-product/work-section/all-section',
    method: 'get'
  });
};
